package cz.boxdesign.library.web.validation;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

import cz.boxdesign.library.entity.Department;


public class DepartmentValidator implements Validator {

  @Override
  public boolean supports(Class<?> clazz) {
    return clazz == Department.class;
  }

  @Override
  public void validate(Object target, Errors errors) {
	  ValidationUtils.rejectIfEmptyOrWhitespace(errors, "nazev", "error.field.required");
  }

}
